package com.woniuxy.lrz.carlproject.controller;

import com.woniuxy.lrz.carlproject.common.Log;
import com.woniuxy.lrz.carlproject.common.Result;
import com.woniuxy.lrz.carlproject.controller.form.approveform.ShopRegisterForm;
import com.woniuxy.lrz.carlproject.service.ApproveService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lrz
 * @since 2022-09-28
 */
@RestController
@RequestMapping("/approve")
@Slf4j
@Api("门店申请接口")
public class ApproveController {

    @Resource
    private ApproveService approveService;

    @PostMapping("/doShopRegister")
    @Log("门店入驻申请")
    @ApiOperation("添加申请信息")
    @ApiImplicitParam("添加申请的表单")
    public Result shopRegister(@RequestBody  @Valid  ShopRegisterForm shopRegisterForm){
        log.info("申请资料:{}",shopRegisterForm);
       approveService.addShopRegister(shopRegisterForm);
       return Result.success();
    }
}
